<div class="nav">
    <a href="{:U('index')}">模型列表</a>
    <a class="sel">属性管理</a>
    <a href="{:U('attr_add',array('model_id'=>$model_id))}">添加属性</a>
</div>
<div class="search">
    <select name="model_id_sel" id="model_id_sel" class="sel1">
        <foreach name="model_list" item="item_m">
        <option value="{$item_m.model_id}">{$item_m.model_name}</option>
        </foreach>
    </select>
</div>
<div class="list">
    <table class="table_list">
        <thead><tr>
                <td>属性名称</td>
                <td width="80px">属性类别</td>
                <td>属性值</td>
                <td width="80px">搜索选项</td>
                <td width="80px">顺序编号</td>
                <td width="80px">是否启用</td>
                <td width="180px">操作</td>
            </tr>
        </thead>
        <tbody>
        <foreach name="list" item="list">
            <tr>
                <td>{$list.attr_name}</td>
                <td>{$list.attr_type_name}</td>
                <td>{$list.options}</td>
                <td>{$list.is_search_name}</td>
                <td class="edit_input" attr_t="order_id" attr_id="{$list.attr_id}">{$list.order_id}</td>
                <td class="edit_toggle" attr_t="is_enable" attr_id="{$list.attr_id}">{$list.is_enable}</td>
                <td>
                    <a class="btn_a" href="{:U('attr_edit',Array('model_id'=>$list['model_id'],'attr_id'=>$list['attr_id']))}">修改</a>&nbsp;
                    <a class="btn_a2" href="{:U('attr_del',Array('model_id'=>$list['model_id'],'attr_id'=>$list['attr_id']))}" onclick="return confirm('确定删除吗？这将删除所有关联的属性选项及商品值')">删除</a></td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <script type="text/javascript">
        $("#model_id_sel").val("{$model_id}");
        $(function(){
            $("#model_id_sel").change(function(){
                var model_id = $("#model_id_sel").val();
                document.location = "{:U('attr_index')}?model_id="+model_id;
            });
        });
    </script>
</div>
